#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int main()
{
	int n = 0;
	int cn = 0;
	scanf("%d", &n);
	if (n < 0)
	{
		cn++;
		n ^= (1 << 31);
	}
	for (int i = 1; i <= 32; i++)
	{
		int temp = n >> 1;
		if ((n - temp * 2) % 2 != 0)
			cn++;
		n = n >> 1;
	}
	printf("%d\n", cn);
	return 0;
}